﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UMLTouch.Core.Entities;

namespace UMLTouch.Domain.ClassDiagram.Patterns
{
    public class Line : IShapePattern
    {
        #region IShapePattern Members

        public ShapePatternMatchingResultEnum Match(Shape shape)
        {
            if (shape.NbMiddleIntersections == 0
               && shape.NbSegments > 3
               && shape.NbExtremityIntersections == shape.NbSegments - 2)
            {
                return ShapePatternMatchingResultEnum.MightMatch;
            }
            else
            {
                return ShapePatternMatchingResultEnum.DontMatch;
            }
               
        }

        public override string ToString()
        {
            return "line";
        }

        #endregion

        #region IShapePattern Members

        public System.Windows.Controls.Control CreateControl()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
